package cn.tedu.oop;

public class TestCat {
    public static void main(String[] args) {
        Cat c1=new Cat();
        c1.setName("叮当");
        c1.setAge(300);
        c1.setKind("机器猫");
        c1.setHost("大雄");
        c1.setPrice(10000);
        System.out.println(c1.getName());
        System.out.println(c1.getAge());
        System.out.println(c1.getKind());
        System.out.println(c1.getHost());
        System.out.println(c1.getPrice());

        Cat c2=new Cat("罗小黑",7,"变异猫","未知",800);
        System.out.println(c2.getName());
        System.out.println(c2.getAge());
        System.out.println(c2.getKind());
        System.out.println(c2.getHost());
        System.out.println(c2.getPrice());

        Cat c3=new Cat();
        c3.eat(5);
        c3.jump("Tom");
        c3.sleep("罗小白",9.9);
        c3.play("苏大强");
    }
}
class Cat{
    private String name;
    private int age;
    private String kind;
    private String host;
    private double price;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
    public Cat(){
        System.out.println("无参构造");
    }

    public Cat(String name, int age, String kind, String host, double price) {
        this.name = name;
        this.age = age;
        this.kind = kind;
        this.host = host;
        this.price = price;
        System.out.println("全参构造");
    }
    public void  eat(int n){
        System.out.println("小猫Cat今晚要吃"+n+"根肉骨头");
    }
    public void jump(String name){
        System.out.println("小猫"+name+"跳得老高了");
    }
    public void sleep(String name,double num){
        System.out.println("小猫"+name+"一共要睡"+num+"个小时");
    }
    public String play(String host){
        System.out.println("小猫与主人"+host+"玩得很开心");
        bark();
        return "逗猫棒";
    }
    private void bark(){
        System.out.println("小猫喜欢喵喵叫");
    }
    {
        System.out.println("又有一只小猫咪来了");
    }
}